From e8d6ac71b72bd7e2a97d5828df3763f8833926c6 Mon Sep 17 00:00:00 2001 From: Richard Hult Date: Sat, 31 Jan 2009 21:25:41 +0100 Subject: [PATCH] Apply non-click-through policy on unfocused windows even if the app is active --- gdk/quartz/gdkevents-quartz.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/gdk/quartz/gdkevents-quartz.c b/gdk/quartz/gdkevents-quartz.c index 58eeadf219..a24ea45369 100644 --- a/gdk/quartz/gdkevents-quartz.c +++ b/gdk/quartz/gdkevents-quartz.c @@ -1526,15 +1526,20 @@ gdk_event_translate (GdkEvent *event, } /* We only activate the application on click if it's not already active, - * this matches most use cases of native apps (no click-through). + * or if it's active but the window isn't focused. This matches most use + * cases of native apps (no click-through). */ if ((event_type == NSRightMouseDown || event_type == NSOtherMouseDown || - event_type == NSLeftMouseDown) && ![NSApp isActive]) + event_type == NSLeftMouseDown)) { - [NSApp activateIgnoringOtherApps:YES]; - return_val = FALSE; - goto done; + GdkWindowObject *private = (GdkWindowObject *)window; + GdkWindowImplQuartz *impl = GDK_WINDOW_IMPL_QUARTZ (private->impl); + + if (![NSApp isActive]) + return FALSE; + else if (![impl->toplevel isMainWindow]) + return FALSE; } current_event_mask = get_event_mask_from_ns_event (nsevent); -- 2.30.2